import asyncio
from util import async_timed, delay

@async_timed()
async def main():
    # 异步任务 总体用时3秒钟 
    # 由于依赖另外一个本地模块util 必须设置PYTHONPATH并在上一级目录执行python命令：python chater2/decorator_time.py
    task_1 = asyncio.create_task(delay(2))
    task_2 = asyncio.create_task(delay(3))
    await task_1
    await task_2

asyncio.run(main())